<extend name="Public/base"/>

<block name="body">
    <script src="__STATIC__/laydate/laydate.js"></script>

    <header class="ui-header ui-header-positive ui-border-b">
        <i class="ui-icon-return" onclick="history.back()"></i>
        <h1>{$meta_title}</h1>
    </header>
    <section class="ui-container">

        <div class="demo-item">
            <p class="demo-desc">{$meta_title}</p>
            <div class="demo-block">
                <div class="ui-form ui-border-t">
                    <div class="ui-form-item ui-border-b">
                        <label>学生</label>
                        <input type="text" id="name" value="" placeholder="学生姓名" >
                    </div>
                    <div class="ui-form-item ui-border-b">
                        <label>生日</label>
                        <input type="text" id="birthday" value="" placeholder="请选择" >
                    </div>
                    <div class="ui-form-item ui-border-b">
                        <label>性别</label>
                        <div class="ui-select">
                            <select id="sex">
                                <option value="1">男</option>
                                <option value="2">女</option>
                            </select>
                        </div>
                    </div>
                    <div class="ui-form-item ui-border-b">
                        <label>家长</label>
                        <input type="text" id="parent_name" value="" placeholder="家长姓名" >
                    </div>
                    <div class="ui-form-item ui-border-b">
                        <label>电话</label>
                        <input type="text" id="parent_phone" value="" placeholder="家长联系电话" >
                    </div>
                    <div class="ui-form-item ui-border-b">
                        <label>地址</label>
                        <input type="text" id="address" value="" placeholder="居住地址" >
                    </div>
                        <div class="ui-form-item ui-border-b">
                            <label>备注</label>
                            <input type="text" id="remark" value="" placeholder="" >
                        </div>
                        <div class="ui-form-item ui-border-b" style="margin-top: 20%;">
                            <button class="ui-btn-lg ui-btn-primary" onclick="save_crt()">
                                确定
                            </button>
                        </div>

                </div>
            </div>
        </div>

    </section><!-- /.ui-container-->

</block>

<block name="script">
    <script type="text/javascript">
        laydate.render({
            elem: '#birthday'
        });
        //保存
        function save_crt() {
            var name = $('#name').val();
            var birthday = $("#birthday").val();
            var sex = $("#sex").val();
            var parent_name = $("#parent_name").val();
            var parent_phone = $("#parent_phone").val();
            var address = $("#address").val();
            var remark = $("#remark").val();

            $.ajax({
                type: "post",
                url: "{:U('save')}",
                data: "name=" + name + "&birthday=" + birthday+ "&sex=" + sex+ "&parent_name=" + parent_name+ "&parent_phone=" + parent_phone+ "&address=" + address+ "&remark=" + remark,
                success: function (result) {
                    if (result.status == 1) {
                        ok(result.info, result.url);
                    } else {
                        tip(result.info);
                    }
                }
            });
        }

    </script>
</block>